<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>动态切换页面背景与调整页面大小</title>

<link href="css/style_100225.css" type="text/css" rel="stylesheet" />

</head>

<body>

<div class="page" id="divPage" style="height: 720px; width: 960px; ">
  <div class="intro intro-wing5" id="divIntro"><!--主题切换-->
    <div class="changetheme fortheme" id="divChangeTheme">
      <span class="t1" onMouseOver="fChangeTheme(0)">1</span> 
      <span class="t2" onMouseOver="fChangeTheme(1)">2</span> 
      <span class="t3" onMouseOver="fChangeTheme(2)">3</span> 
      <span class="t4" onMouseOver="fChangeTheme(3)">4</span> 
      <span class="t5" onMouseOver="fChangeTheme(4)">5</span> 
    </div>
    <div class="introtxt introtxt-wing1"><a class="piclink" href="" target="_blank"></a></div>
    <div class="introtxt introtxt-wing2"><a class="piclink" href="" target="_blank"></a></div>
    <div class="introtxt introtxt-wing3"><a class="piclink" href="" target="_blank"></a></div>
    <div class="introtxt introtxt-wing4"><a class="piclink" href="" target="_blank"></a></div>
    <div class="introtxt introtxt-wing5"><a class="piclink" href="" target="_blank"></a></div>
    <div class="introtxt introtxt-at"><a class="piclink" href="" target="_blank"></a></div>
  </div>
</div>
<script type="text/javascript">
var arrTigerThemes = ["wing1","wing2","wing3","wing4","wing5","wing6","wing7"];
var arrThemes = [];
arrThemes[0] = "wing1";	/* 开放之翼 */
arrThemes[1] = "wing2";	/* 海纳之翼 */
arrThemes[2] = "wing3";	/* 绿色之翼 */
arrThemes[3] = "wing4";	/* 灵犀之翼 */
arrThemes[4] = "wing5";	/* 随身之翼 */
arrThemes[5] = "at";	
	
function $( id ){return document.getElementById( id );}
//第一张图片随机选择
$("divIntro").className = "intro intro-" + arrThemes[Math.floor(arrThemes.length * Math.random())];
function fChangeTheme(n){
  document.getElementById("divIntro").className = "intro intro-" + arrTigerThemes[n];
}
window.onresize = function(){
  var minh = 720;
  var minw = 960;
  $("divPage").style.height = document.documentElement.offsetHeight < minh ? minh+"px" : "100%";
  $("divPage").style.width = document.documentElement.offsetWidth < minw ? minw+"px" : "auto";
}
window.onresize();
</script>
</body>
</html>
